<template>
	<view class="xueyapage">
		<view class="box">
			<view class="itemselect">
				<view class="itemtitle">
					当前血糖
				</view>
				<view class="pickerbox">
				<input type="number" placeholder="请输入血糖" class="picker" v-model="xuetang" />
				</view>
			</view>
		</view>

		<view class="bannerbox">
			<view class="title">
				请选择测量时间段
			</view>
			<view class="listbox">
				<view class="itemlist" :class="time==1?'act':''" @click="selecttime(1)">
					空腹
				</view>
				<view class="itemlist" :class="time==2?'act':''" @click="selecttime(2)">
					早餐后2小时
				</view>
				<view class="itemlist" :class="time==3?'act':''" @click="selecttime(3)">
				  午餐前
				</view>
				<view class="itemlist" :class="time==4?'act':''" @click="selecttime(4)">
					午饭后2小时
				</view>
				<view class="itemlist" :class="time==5?'act':''" @click="selecttime(5)">
					晚餐前
				</view>
				<view class="itemlist" :class="time==6?'act':''" @click="selecttime(6)">
					晚餐后2小时
				</view>
				<view class="itemlist" :class="time==7?'act':''" @click="selecttime(7)">
					睡前
				</view>
				<view class="itemlist" :class="time==8?'act':''" @click="selecttime(8)">
					随机
				</view>
			</view>
		</view>
		<view class="title">
			营养食疗师叮嘱：完整记录某一餐的餐前和餐后血糖值更具参考意义哦~
		</view>
		<view class="addbox">
			<image class="image" src="/static/image/魂牵梦萦f.jpg" mode=""></image>
			<view class="add"  @click="addpicture">
				<view class="fang">
					+
				</view>
				<view class="addtitle">
					添加测量照片
				</view>
			</view>
		</view>
		<view class="pagebtn">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				xuetang:'',
				list:[],
				time:''
			}
		},
		mounted() {
			for (let i = 1; i <= 15; i++) {
			  this.list.push(i);
			}
		
		},
		methods: {
			selecttime(e){
				this.time=e
			},
			bindPickerChange(e){
				this.xuetang=this.list[e.detail.value]
			},
	
			
		}
	}
</script>

<style lang="less" scoped>
	.xueyapage{
		width: 100%;
		.box{
			width: 100%;
			margin-top: 40rpx;
			background-color: white;
			box-sizing: border-box;
			padding: 20rpx;
			.itemselect{
				width: 100%;
				text-align: center;
				.itemtitle{
					font-weight: bold;
					color:#0a0a0a ;
				}
			}
			.pickerbox{
				width: 50%;
				height: 80rpx;
				border: 1rpx solid #1A4f8A;
				text-align: center;
				line-height: 80rpx;
				font-size: 36rpx;
				font-weight: bold;
				margin: auto;
				margin-top: 20rpx;
				 border-radius: 10rpx;
				 
				.picker{
					width: 100%;
					height: 100%;
				}
			}
		}
		.addbox{
			width: 100%;
			margin-top: 40rpx;
			background-color: white;
			box-sizing: border-box;
			padding: 20rpx;
			position: relative;
			height: 300rpx;
			display: flex;
			align-items: center;
			.image{
				width: 200rpx;
				height: 200rpx;
			}
			.title{
				
				font-size: 28rpx;
				color: #c1c1c1;
			}
			.add{
				width: 30%;
				
				
				text-align: center;
				.fang{
					margin: auto;
					width: 90rpx;
					height: 90rpx;
					border-radius: 20rpx;
					border: 2rpx solid #e1e1e1;
					line-height: 80rpx;
					text-align: center;
					font-size: 60rpx;
					font-weight: bold;
					color: gray;
				}
				.addtitle{
					margin-top: 10rpx;
					font-size: 30rpx;
					color: gray;
					width: 60%;
				}
			}
		}
		.bannerbox{
			width: 100%;
			background-color: white;
			box-sizing: border-box;
			padding: 20rpx;
	       .title{
			   text-align: center;
		   }	
			   .listbox{
				   width: 100%;
				   display: flex;
				   align-items: flex-start;
				   flex-wrap: wrap;
				   .itemlist{
					   width: 40%;
					   height: 60rpx;
					   text-align: center;
					   line-height: 60rpx;
					   background-color: #E5E5E5;
					   border-radius: 30rpx;
					   margin: 5%;
					   font-size: 30rpx;
					   font-weight: bold;
					   color: #333333;
				   }
				   .act{
					   background-color: #1A4f8A !important;
					   color: white !important;
				   }
				   
			   }
	
		
	
		}
		.title{
			width: 100%;
			box-sizing: border-box;
			padding: 50rpx;
			font-size: 26rpx;
			color: gray;
		}
		.pagebtn{
			text-align: center;
			font-weight: bold;
			color: white;
			border-radius: 20rpx;
			margin: auto;
			margin-top: 80rpx;
			width: 80%;
			height: 90rpx;
			line-height: 90rpx;
			background-color: #1A4f8A;
			
		}
	}
</style>